package com.item.manager.serialize;

import static java.lang.String.format;

/**
 * Carries properties from json to Attribute.
 *
 * Created by Alexey on 3/3/2015.
 */
public abstract class AttributeAdaptor {
    private String name;

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public abstract Object getValue();

    /**
     * Parser and sets attribute value from String
     */
    public abstract void valueFromString(String s);

    @Override public String toString() {
        return format("Type: %s, Name: %s, Value: %s", getClass().getSimpleName(), getName(), getValue());
    }
}
